import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import plotly.express as px
import plotly
plotly.offline.init_notebook_mode()
df_vac = pd.read_csv('./data/vaccinations.csv')
df_covid = pd.read_csv('./data/owid-covid-data.csv')
df_vac.columns
df_covid.columns
np.unique(np.array(df_covid['location']))
new_df = df_covid[['location','date','new_tests','new_cases']]
countries = ['India','Morocco','Brazil','United States','France']
final_df = new_df[0:0]
final_df.columns
final_df.head
new_df = new_df.sort_values('location')
for index,row in new_df.iterrows():
if row['location'] in countries:
final_df.loc[len(final_df.index)] = row
# final_df = final_df.sort_values('date')
# final_df = final_df.reset_index(drop = True)
India_df = final_df[0:0]
for index,row in final_df.iterrows():
if row['location'] == 'India':
India_df.loc[len(India_df.index)] = row
India_df = India_df.sort_values('date')
India_df = India_df.reset_index(drop = True)
# India_df['new_tests_per_thousand'] = India_df['new_tests_per_thousand'].apply(lambda x:x*1000)
India_df.columns = ['location','date','new_tests','new_cases']
print(India_df)
US_df = final_df[0:0]
for index,row in final_df.iterrows():
if row['location'] == 'United States':
US_df.loc[len(US_df.index)] = row
US_df = US_df.sort_values('date')
US_df = US_df.reset_index(drop = True)
# US_df['new_tests_per_thousand'] = US_df['new_tests_per_thousand'].apply(lambda x:x*1000)
US_df.columns = ['location','date','new_tests','new_cases']
Brazil_df = final_df[0:0]
for index,row in final_df.iterrows():
if row['location'] == 'Brazil':
Brazil_df.loc[len(Brazil_df.index)] = row
Brazil_df = Brazil_df.sort_values('date')
Brazil_df = Brazil_df.reset_index(drop = True)
# Brazil_df['new_tests_per_thousand'] = Brazil_df['new_tests_per_thousand'].apply(lambda x:x*1000)
Brazil_df.columns = ['location','date','new_tests','new_cases']
Morocco_df = final_df[0:0]
for index,row in final_df.iterrows():
if row['location'] == 'Morocco':
Morocco_df.loc[len(Morocco_df.index)] = row
Morocco_df = Morocco_df.sort_values('date')
Morocco_df = Morocco_df.reset_index(drop = True)
# Morocco_df['new_tests_per_thousand'] = Morocco_df['new_tests_per_thousand'].apply(lambda x:x*1000)
Morocco_df.columns = ['location','date','new_tests','new_cases']
France_df = final_df[0:0]
for index,row in final_df.iterrows():
if row['location'] == 'France':
France_df.loc[len(France_df.index)] = row
France_df = France_df.sort_values('date')
France_df = France_df.reset_index(drop = True)
# France_df['new_tests_per_thousand'] = France_df['new_tests_per_thousand'].apply(lambda x:x*1000)
France_df.columns = ['location','date','new_tests','new_cases']
fig1 = px.line(India_df, x="date", y=['new_cases','new_tests'], title = 'India')
fig1.show()
fig2 = px.line(US_df, x="date", y=['new_cases','new_tests'], title = 'United States')
fig2.show()
fig3 = px.line(Brazil_df, x="date", y=['new_cases','new_tests'], title = 'Brazil')
fig3.show()
fig4 = px.line(Morocco_df, x="date", y=['new_cases','new_tests'], title = 'Morocco')
fig4.show()
fig5 = px.line(France_df, x="date", y=['new_cases','new_tests'], title = 'France')
fig5.show()
C:\Users\Paras_Gupta\anaconda3\lib\site-packages\pandas\core\indexing.py:723: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy iloc._setitem_with_indexer(indexer, value, self.name)
location date new_tests new_cases 0 India 2020-01-30 NaN 1.0 1 India 2020-01-31 NaN 0.0 2 India 2020-02-01 NaN 0.0 3 India 2020-02-02 NaN 1.0 4 India 2020-02-03 NaN 1.0 .. ... ... ... ... 791 India 2022-03-31 607987.0 1335.0 792 India 2022-04-01 606036.0 1260.0 793 India 2022-04-02 528021.0 1096.0 794 India 2022-04-03 465904.0 913.0 795 India 2022-04-04 314823.0 795.0 [796 rows x 4 columns]
C:\Users\Paras_Gupta\anaconda3\lib\site-packages\pandas\core\indexing.py:723: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy iloc._setitem_with_indexer(indexer, value, self.name)
new_df = df_covid[['location','date','human_development_index','total_cases_per_million','population']]
new_df.head
a = []
for idx,row in new_df.iterrows():
if row['location'] == 'India':
a.append(row['human_development_index'])
print(np.unique(np.array(a)))
countries = np.unique(np.array(new_df['location']))
# countries = countries[::10]
# countries = np.append(countries,'India')
countries
print(countries)
new_df = new_df.sort_values('date')
new_df = new_df.reset_index(drop = True)
new_df = new_df[170000:].reset_index(drop = True)
new_df.head
final = []
for country in countries:
for idx,row in new_df.iterrows():
if row['date'] == '2022-04-04' and row['location'] == country:
human_development_index = row['human_development_index']
total_cases_per_million = row['total_cases_per_million']
population = row['population']
if row['human_development_index']>0 and row['total_cases_per_million']>0:
final.append((country,human_development_index,total_cases_per_million,population))
print(final)
final_df = pd.DataFrame(final, columns = ['country','human_development_index','total_cases_per_million','population'])
fig = px.scatter(final_df, x="human_development_index", y="total_cases_per_million", hover_data=['country'], color = 'country')
fig.show()
[0.645]
['Afghanistan' 'Africa' 'Albania' 'Algeria' 'Andorra' 'Angola' 'Anguilla'
'Antigua and Barbuda' 'Argentina' 'Armenia' 'Aruba' 'Asia' 'Australia'
'Austria' 'Azerbaijan' 'Bahamas' 'Bahrain' 'Bangladesh' 'Barbados'
'Belarus' 'Belgium' 'Belize' 'Benin' 'Bermuda' 'Bhutan' 'Bolivia'
'Bonaire Sint Eustatius and Saba' 'Bosnia and Herzegovina' 'Botswana'
'Brazil' 'British Virgin Islands' 'Brunei' 'Bulgaria' 'Burkina Faso'
'Burundi' 'Cambodia' 'Cameroon' 'Canada' 'Cape Verde' 'Cayman Islands'
'Central African Republic' 'Chad' 'Chile' 'China' 'Colombia' 'Comoros'
'Congo' 'Cook Islands' 'Costa Rica' "Cote d'Ivoire" 'Croatia' 'Cuba'
'Curacao' 'Cyprus' 'Czechia' 'Democratic Republic of Congo' 'Denmark'
'Djibouti' 'Dominica' 'Dominican Republic' 'Ecuador' 'Egypt'
'El Salvador' 'Equatorial Guinea' 'Eritrea' 'Estonia' 'Eswatini'
'Ethiopia' 'Europe' 'European Union' 'Faeroe Islands' 'Falkland Islands'
'Fiji' 'Finland' 'France' 'French Polynesia' 'Gabon' 'Gambia' 'Georgia'
'Germany' 'Ghana' 'Gibraltar' 'Greece' 'Greenland' 'Grenada' 'Guam'
'Guatemala' 'Guernsey' 'Guinea' 'Guinea-Bissau' 'Guyana' 'Haiti'
'High income' 'Honduras' 'Hong Kong' 'Hungary' 'Iceland' 'India'
'Indonesia' 'International' 'Iran' 'Iraq' 'Ireland' 'Isle of Man'
'Israel' 'Italy' 'Jamaica' 'Japan' 'Jersey' 'Jordan' 'Kazakhstan' 'Kenya'
'Kiribati' 'Kosovo' 'Kuwait' 'Kyrgyzstan' 'Laos' 'Latvia' 'Lebanon'
'Lesotho' 'Liberia' 'Libya' 'Liechtenstein' 'Lithuania' 'Low income'
'Lower middle income' 'Luxembourg' 'Macao' 'Madagascar' 'Malawi'
'Malaysia' 'Maldives' 'Mali' 'Malta' 'Marshall Islands' 'Mauritania'
'Mauritius' 'Mexico' 'Micronesia (country)' 'Moldova' 'Monaco' 'Mongolia'
'Montenegro' 'Montserrat' 'Morocco' 'Mozambique' 'Myanmar' 'Namibia'
'Nauru' 'Nepal' 'Netherlands' 'New Caledonia' 'New Zealand' 'Nicaragua'
'Niger' 'Nigeria' 'Niue' 'North America' 'North Macedonia'
'Northern Cyprus' 'Northern Mariana Islands' 'Norway' 'Oceania' 'Oman'
'Pakistan' 'Palau' 'Palestine' 'Panama' 'Papua New Guinea' 'Paraguay'
'Peru' 'Philippines' 'Pitcairn' 'Poland' 'Portugal' 'Puerto Rico' 'Qatar'
'Romania' 'Russia' 'Rwanda' 'Saint Helena' 'Saint Kitts and Nevis'
'Saint Lucia' 'Saint Pierre and Miquelon'
'Saint Vincent and the Grenadines' 'Samoa' 'San Marino'
'Sao Tome and Principe' 'Saudi Arabia' 'Senegal' 'Serbia' 'Seychelles'
'Sierra Leone' 'Singapore' 'Sint Maarten (Dutch part)' 'Slovakia'
'Slovenia' 'Solomon Islands' 'Somalia' 'South Africa' 'South America'
'South Korea' 'South Sudan' 'Spain' 'Sri Lanka' 'Sudan' 'Suriname'
'Sweden' 'Switzerland' 'Syria' 'Taiwan' 'Tajikistan' 'Tanzania'
'Thailand' 'Timor' 'Togo' 'Tokelau' 'Tonga' 'Trinidad and Tobago'
'Tunisia' 'Turkey' 'Turkmenistan' 'Turks and Caicos Islands' 'Tuvalu'
'Uganda' 'Ukraine' 'United Arab Emirates' 'United Kingdom'
'United States' 'United States Virgin Islands' 'Upper middle income'
'Uruguay' 'Uzbekistan' 'Vanuatu' 'Vatican' 'Venezuela' 'Vietnam'
'Wallis and Futuna' 'World' 'Yemen' 'Zambia' 'Zimbabwe']
[('Afghanistan', 0.511, 4465.799, 39835428.0), ('Albania', 0.795, 95342.601, 2872934.0), ('Algeria', 0.748, 5955.045, 44616626.0), ('Andorra', 0.868, 517413.45, 77354.0), ('Angola', 0.581, 2923.178, 33933611.0), ('Antigua and Barbuda', 0.778, 75895.389, 98728.0), ('Argentina', 0.845, 198288.232, 45605823.0), ('Armenia', 0.776, 142372.903, 2968128.0), ('Australia', 0.944, 185061.806, 25788217.0), ('Austria', 0.922, 431231.776, 9043072.0), ('Azerbaijan', 0.756, 77476.313, 10223344.0), ('Bahamas', 0.814, 83930.02, 396914.0), ('Bahrain', 0.852, 318460.557, 1748295.0), ('Bangladesh', 0.632, 11736.56, 166303494.0), ('Barbados', 0.814, 209100.894, 287708.0), ('Belarus', 0.823, 102262.798, 9442867.0), ('Belgium', 0.931, 333683.937, 11632334.0), ('Belize', 0.716, 141518.59, 404915.0), ('Benin', 0.545, 2164.64, 12451031.0), ('Bhutan', 0.654, 40937.3, 779900.0), ('Bolivia', 0.718, 76269.913, 11832936.0), ('Bosnia and Herzegovina', 0.78, 115133.973, 3263459.0), ('Botswana', 0.735, 127449.066, 2397240.0), ('Brazil', 0.765, 140262.977, 213993441.0), ('Brunei', 0.838, 308865.496, 441532.0), ('Bulgaria', 0.816, 165567.076, 6896655.0), ('Burkina Faso', 0.452, 970.271, 21497097.0), ('Burundi', 0.433, 3148.645, 12255429.0), ('Cambodia', 0.594, 8012.417, 16946446.0), ('Cameroon', 0.563, 4391.083, 27224262.0), ('Canada', 0.929, 92188.558, 38067913.0), ('Cape Verde', 0.665, 99592.277, 561901.0), ('Central African Republic', 0.397, 2977.447, 4919987.0), ('Chad', 0.398, 434.349, 16914985.0), ('Chile', 0.851, 181649.346, 19212362.0), ('China', 0.761, 199.103, 1444216102.0), ('Colombia', 0.767, 118719.071, 51265841.0), ('Comoros', 0.554, 9109.061, 888456.0), ('Congo', 0.574, 4255.069, 5657017.0), ('Costa Rica', 0.81, 163331.26, 5139053.0), ("Cote d'Ivoire", 0.538, 3022.552, 27053629.0), ('Croatia', 0.851, 270191.003, 4081657.0), ('Cuba', 0.783, 96590.784, 11317498.0), ('Cyprus', 0.887, 495727.144, 896005.0), ('Czechia', 0.9, 357951.329, 10724553.0), ('Democratic Republic of Congo', 0.48, 939.055, 92377986.0), ('Denmark', 0.94, 527922.169, 5813302.0), ('Djibouti', 0.524, 15555.824, 1002197.0), ('Dominica', 0.742, 164759.186, 72172.0), ('Dominican Republic', 0.756, 52786.571, 10953714.0), ('Ecuador', 0.759, 48205.398, 17888474.0), ('Egypt', 0.707, 4883.802, 104258327.0), ('El Salvador', 0.673, 24786.377, 6518500.0), ('Equatorial Guinea', 0.592, 11035.312, 1449891.0), ('Eritrea', 0.459, 2701.125, 3601462.0), ('Estonia', 0.892, 421927.304, 1325188.0), ('Eswatini', 0.611, 59590.453, 1172369.0), ('Ethiopia', 0.485, 3985.901, 117876226.0), ('Fiji', 0.743, 71353.496, 902899.0), ('Finland', 0.938, 162450.857, 5548361.0), ('France', 0.901, 386865.163, 67422000.0), ('Gabon', 0.703, 20882.655, 2278829.0), ('Gambia', 0.496, 4820.79, 2486937.0), ('Georgia', 0.812, 414453.287, 3979773.0), ('Germany', 0.947, 258715.222, 83900471.0), ('Ghana', 0.611, 5072.808, 31732128.0), ('Greece', 0.888, 298545.032, 10370747.0), ('Grenada', 0.779, 124089.723, 113015.0), ('Guatemala', 0.663, 45542.74, 18249868.0), ('Guinea', 0.477, 2701.22, 13497237.0), ('Guinea-Bissau', 0.48, 4044.178, 2015490.0), ('Guyana', 0.682, 80059.064, 790329.0), ('Haiti', 0.51, 2648.401, 11541683.0), ('Honduras', 0.634, 41848.48, 10062994.0), ('Hong Kong', 0.949, 155513.187, 7552800.0), ('Hungary', 0.854, 192460.745, 9634162.0), ('Iceland', 0.949, 493042.148, 368792.0), ('India', 0.645, 30880.982, 1393409033.0), ('Indonesia', 0.718, 21767.655, 276361788.0), ('Iran', 0.783, 84338.111, 85028760.0), ('Iraq', 0.674, 56351.689, 41179351.0), ('Ireland', 0.955, 295886.495, 4982904.0), ('Israel', 0.919, 425948.983, 9291000.0), ('Italy', 0.892, 246443.055, 60367471.0), ('Jamaica', 0.734, 43339.716, 2973462.0), ('Japan', 0.919, 53396.363, 126050796.0), ('Jordan', 0.729, 164983.189, 10269022.0), ('Kazakhstan', 0.825, 73383.632, 18994958.0), ('Kenya', 0.601, 5882.766, 54985702.0), ('Kiribati', 0.63, 25266.089, 121388.0), ('Kuwait', 0.806, 145435.438, 4328553.0), ('Kyrgyzstan', 0.697, 30319.475, 6628347.0), ('Laos', 0.613, 25015.455, 7379358.0), ('Latvia', 0.866, 430056.445, 1866934.0), ('Lebanon', 0.744, 161507.255, 6769151.0), ('Lesotho', 0.527, 15242.695, 2159067.0), ('Liberia', 0.48, 1428.514, 5180208.0), ('Libya', 0.724, 72103.939, 6958538.0), ('Liechtenstein', 0.919, 429471.428, 38254.0), ('Lithuania', 0.882, 383565.774, 2689862.0), ('Luxembourg', 0.916, 345597.293, 634814.0), ('Madagascar', 0.528, 2253.113, 28427333.0), ('Malawi', 0.483, 4360.006, 19647681.0), ('Malaysia', 0.81, 129864.647, 32776195.0), ('Maldives', 0.74, 326818.366, 543620.0), ('Mali', 0.434, 1462.716, 20855724.0), ('Malta', 0.895, 159128.076, 516100.0), ('Marshall Islands', 0.704, 117.414, 59618.0), ('Mauritania', 0.546, 12293.958, 4775110.0), ('Mauritius', 0.804, 165178.557, 1273428.0), ('Mexico', 0.779, 43503.949, 130262220.0), ('Micronesia (country)', 0.62, 8.602, 116255.0), ('Moldova', 0.75, 127787.973, 4024025.0), ('Mongolia', 0.737, 276198.892, 3329282.0), ('Montenegro', 0.829, 371570.143, 628051.0), ('Morocco', 0.686, 31157.254, 37344787.0), ('Mozambique', 0.456, 7003.908, 32163045.0), ('Myanmar', 0.583, 11165.308, 54806014.0), ('Namibia', 0.646, 60975.27, 2587344.0), ('Nepal', 0.602, 32974.209, 29674920.0), ('Netherlands', 0.944, 466716.889, 17173094.0), ('New Zealand', 0.931, 139993.758, 5126300.0), ('Nicaragua', 0.66, 2750.367, 6702379.0), ('Niger', 0.394, 350.605, 25130810.0), ('Nigeria', 0.539, 1208.454, 211400704.0), ('North Macedonia', 0.774, 147268.807, 2082661.0), ('Norway', 0.957, 257985.129, 5465629.0), ('Oman', 0.813, 74377.184, 5223376.0), ('Pakistan', 0.557, 6775.202, 225199929.0), ('Palau', 0.826, 222405.634, 18174.0), ('Palestine', 0.708, 125659.135, 5222756.0), ('Panama', 0.815, 174671.346, 4381583.0), ('Papua New Guinea', 0.555, 4756.44, 9119005.0), ('Paraguay', 0.728, 89804.05, 7219641.0), ('Peru', 0.777, 106378.274, 33359415.0), ('Philippines', 0.718, 33136.996, 111046910.0), ('Poland', 0.88, 157952.06, 37797000.0), ('Portugal', 0.864, 355022.948, 10167923.0), ('Qatar', 0.848, 123529.785, 2930524.0), ('Romania', 0.828, 149595.363, 19127772.0), ('Russia', 0.824, 120970.485, 145912022.0), ('Rwanda', 0.543, 9771.614, 13276517.0), ('Saint Kitts and Nevis', 0.779, 103630.523, 53546.0), ('Saint Lucia', 0.759, 124538.37, 184401.0), ('Saint Vincent and the Grenadines', 0.738, 74908.555, 111269.0), ('Samoa', 0.715, 13100.568, 200144.0), ('Sao Tome and Principe', 0.625, 26629.179, 223364.0), ('Saudi Arabia', 0.854, 21255.392, 35340680.0), ('Senegal', 0.512, 4996.421, 17196308.0), ('Serbia', 0.806, 288463.864, 6871547.0), ('Seychelles', 0.796, 413163.482, 98910.0), ('Sierra Leone', 0.452, 942.719, 8141343.0), ('Singapore', 0.938, 203488.338, 5453600.0), ('Slovakia', 0.86, 451858.689, 5449270.0), ('Slovenia', 0.917, 468890.756, 2078723.0), ('Solomon Islands', 0.567, 16292.729, 703995.0), ('South Africa', 0.709, 62005.833, 60041996.0), ('South Korea', 0.916, 278088.877, 51305184.0), ('South Sudan', 0.433, 1520.115, 11381377.0), ('Spain', 0.904, 247117.806, 46745211.0), ('Sri Lanka', 0.782, 30799.348, 21497306.0), ('Sudan', 0.51, 1379.802, 44909351.0), ('Suriname', 0.738, 133890.28, 591798.0), ('Sweden', 0.945, 244863.491, 10160159.0), ('Switzerland', 0.955, 402422.284, 8715494.0), ('Syria', 0.567, 3048.747, 18275704.0), ('Tajikistan', 0.668, 1824.275, 9749625.0), ('Tanzania', 0.529, 549.851, 61498438.0), ('Thailand', 0.777, 53717.365, 69950844.0), ('Timor', 0.606, 16989.675, 1343875.0), ('Togo', 0.515, 4357.625, 8478242.0), ('Tonga', 0.725, 67760.095, 106759.0), ('Trinidad and Tobago', 0.796, 98899.509, 1403374.0), ('Tunisia', 0.74, 86788.244, 11935764.0), ('Turkey', 0.82, 175292.785, 85042736.0), ('Uganda', 0.544, 3479.132, 47123533.0), ('Ukraine', 0.779, 115962.423, 43466822.0), ('United Arab Emirates', 0.89, 89326.653, 9991083.0), ('United Kingdom', 0.932, 314171.29, 68207114.0), ('United States', 0.926, 240840.068, 332915074.0), ('Uruguay', 0.817, 255409.233, 3485152.0), ('Uzbekistan', 0.72, 7009.95, 33935765.0), ('Vanuatu', 0.609, 14090.643, 314464.0), ('Venezuela', 0.711, 18146.872, 28704947.0), ('Vietnam', 0.704, 100510.978, 98168829.0), ('World', 0.737, 62521.828, 7874965730.0), ('Yemen', 0.47, 387.266, 30490639.0), ('Zambia', 0.584, 16759.989, 18920657.0), ('Zimbabwe', 0.571, 16340.393, 15092171.0)]
df = pd.read_csv('./data/country_vaccinations_by_manufacturer.csv')
df.head
np.unique(np.array(df['vaccine']))
np.unique(np.array(df['location']))
c = []
for index,row in df.iterrows():
if row['vaccine'] == 'Johnson&Johnson' and row['location'] not in c:
c.append(row['location'])
print(c)
np.unique(np.array(df['location']))
countries = ['Argentina','Belgium','Denmark','France','Germany','Italy','Japan','Nepal','Norway','Peru','Portugal','South Africa','South Korea','Spain','Ukraine','United States',]
vaccines = ['Moderna','Pfizer/BioNTech','Johnson&Johnson','Oxford/AstraZeneca']
new_df = df[0:0]
for index,row in df.iterrows():
if row['location'] in countries and row['vaccine'] in vaccines:
new_df.loc[len(new_df.index)] = row
print(new_df)
c = []
for index,row in new_df.iterrows():
if row['vaccine'] == 'Covaxin':
print(row)
c = []
for index,row in new_df[::-1].iterrows():
print(row)
break
final_vacs = {}
for vaccine in vaccines:
print(vaccine)
vac = []
country_list = countries.copy()
for index,row in new_df[::-1].iterrows():
if row['vaccine'] == vaccine and row['location'] in country_list:
vac.append((row['location'],row['total_vaccinations']))
country_list.remove(row['location'])
final_vacs[vaccine] = vac
print(final_vacs)
print(countries)
final_vacs.keys()
vs = []
for vaccine in final_vacs.keys():
print(vaccine)
v = []
for country in countries:
for i in range(len(final_vacs[vaccine])):
if final_vacs[vaccine][i][0] == country:
v.append(final_vacs[vaccine][i][1])
break
elif i == (len(final_vacs[vaccine]) - 1) :
v.append(0)
vs.append(v)
print(vs)
vs[3]
x = countries
plot = px.Figure(data=[
go.Bar(name = 'Moderna', x = x, y = vs[0]),
go.Bar(name = 'Pfizer/BioNTech', x = x, y = vs[1]),
go.Bar(name = 'Johnson&Johnson', x = x, y = vs[2]),
go.Bar(name = 'Oxford/AstraZeneca', x = x, y = vs[3]),
])
plot.update_layout(barmode='stack', height = 800)
plot.show()
['Austria', 'Belgium', 'Bulgaria', 'Croatia', 'Cyprus', 'Czechia', 'Denmark', 'Estonia', 'Finland', 'France', 'Germany', 'Hungary', 'Iceland', 'Ireland', 'Italy', 'Latvia', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Malta', 'Nepal', 'Netherlands', 'Norway', 'Poland', 'Portugal', 'Romania', 'Slovakia', 'Slovenia', 'South Africa', 'South Korea', 'Spain', 'Switzerland', 'Ukraine', 'United States', 'European Union']
C:\Users\Paras_Gupta\anaconda3\lib\site-packages\pandas\core\indexing.py:723: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
location date vaccine total_vaccinations
0 Argentina 2020-12-29 Moderna 2
1 Argentina 2020-12-29 Oxford/AstraZeneca 3
2 Argentina 2020-12-30 Moderna 2
3 Argentina 2020-12-30 Oxford/AstraZeneca 3
4 Argentina 2020-12-31 Moderna 2
... ... ... ... ...
12744 United States 2022-03-28 Moderna 210281861
12745 United States 2022-03-28 Pfizer/BioNTech 330607980
12746 United States 2022-03-29 Johnson&Johnson 18563903
12747 United States 2022-03-29 Moderna 210341785
12748 United States 2022-03-29 Pfizer/BioNTech 330748673
[12749 rows x 4 columns]
location United States
date 2022-03-29
vaccine Pfizer/BioNTech
total_vaccinations 330748673
Name: 12748, dtype: object
Moderna
Pfizer/BioNTech
Johnson&Johnson
Oxford/AstraZeneca
{'Moderna': [('United States', 210341785), ('Ukraine', 3044899), ('Spain', 23568112), ('South Korea', 24227253), ('Portugal', 3571688), ('Norway', 2262005), ('Nepal', 5630789), ('Japan', 5687427), ('Italy', 33612044), ('Germany', 29435818), ('France', 23535156), ('Denmark', 1708672), ('Belgium', 4267394), ('Argentina', 6507561)], 'Pfizer/BioNTech': [('United States', 330748673), ('Ukraine', 14774013), ('Spain', 65141278), ('South Korea', 74173406), ('South Africa', 25379326), ('Portugal', 14981060), ('Peru', 39848993), ('Norway', 8840179), ('Nepal', 619997), ('Japan', 86647668), ('Italy', 88556058), ('Germany', 126041243), ('France', 109187212), ('Denmark', 10259219), ('Belgium', 17451842), ('Argentina', 14681054)], 'Johnson&Johnson': [('United States', 18563903), ('Ukraine', 20680), ('Spain', 1980123), ('South Korea', 1542317), ('South Africa', 8190515), ('Portugal', 1133095), ('Norway', 7108), ('Nepal', 3339665), ('Italy', 1507237), ('Germany', 3628087), ('France', 1085968), ('Denmark', 46934), ('Belgium', 425639)], 'Oxford/AstraZeneca': [('Ukraine', 4041487), ('Spain', 9792319), ('South Korea', 20315509), ('Portugal', 2245876), ('Peru', 5399621), ('Norway', 147371), ('Nepal', 10764832), ('Italy', 12165527), ('Germany', 12757971), ('France', 7857861), ('Denmark', 155689), ('Belgium', 2846716), ('Argentina', 25977231)]}
['Argentina', 'Belgium', 'Denmark', 'France', 'Germany', 'Italy', 'Japan', 'Nepal', 'Norway', 'Peru', 'Portugal', 'South Africa', 'South Korea', 'Spain', 'Ukraine', 'United States']
Moderna
Pfizer/BioNTech
Johnson&Johnson
Oxford/AstraZeneca
[[6507561, 4267394, 1708672, 23535156, 29435818, 33612044, 5687427, 5630789, 2262005, 0, 3571688, 0, 24227253, 23568112, 3044899, 210341785], [14681054, 17451842, 10259219, 109187212, 126041243, 88556058, 86647668, 619997, 8840179, 39848993, 14981060, 25379326, 74173406, 65141278, 14774013, 330748673], [0, 425639, 46934, 1085968, 3628087, 1507237, 0, 3339665, 7108, 0, 1133095, 8190515, 1542317, 1980123, 20680, 18563903], [25977231, 2846716, 155689, 7857861, 12757971, 12165527, 0, 10764832, 147371, 5399621, 2245876, 0, 20315509, 9792319, 4041487, 0]]
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) C:\Users\PARAS_~1\AppData\Local\Temp/ipykernel_8048/3869337957.py in <module> 61 vs[3] 62 x = countries ---> 63 plot = px.Figure(data=[ 64 go.Bar(name = 'Moderna', x = x, y = vs[0]), 65 go.Bar(name = 'Pfizer/BioNTech', x = x, y = vs[1]), AttributeError: module 'plotly.express' has no attribute 'Figure'